home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 05.zip
/
BS1 part 5
/
PDraw3.0.adf
/
pdraw_rex.lzh
/
ClickRadFill.pdrx
< prev
next >
Wrap
Text File
|
1992-06-18
|
1KB
|
51 lines
/*
@N
This Genie will allow you to set the center of a radial fill by clicking at some point on the screen.
You may also set the angle of a linear fill relative to the center of the currently selected object.
*/
msg = PDSetup.rexx(2,0)
units = getclip(pds_units)
if msg ~= 1 then exit_msg(msg)
obj = pdm_SelFirstObj()
if obj = 0 then exit_msg("Please select objects before running this Genie.")
clickpos = pdm_GetClickPosn("Click at the where you want the center of fill")
if clickpos = "0 0" then exit_msg()
x = word(clickpos, 1)
y = word(clickpos, 2)
do while obj ~= 0
opos = pdm_GetObjVisPosn(obj)
osze = pdm_GetObjVisSize(obj)
olft = word(opos, 1)
otop = word(opos, 2)
owid = word(osze, 1)
ohgt = word(osze, 2)
cx = olft + (.5 * owid)
cy = otop + (.5 * ohgt)
px = (x - cx) / (.5 * owid) * 100
py = (y - cy) / (.5 * ohgt) * 100
fillpattern = pdm_GetFillPattern(obj)
parse var fillpattern type '0a'x c1 '0a'x c2 '0a'x steps '0a'x angle '0a'x centerx '0a'x centery
if type ~= 2 then angle = atan2(x - cx,cy - y) * 180 / 3.14159
call pdm_SetFillPattern(obj, type, c1, c2, steps, angle, px , py)
obj = pdm_SelNextObj(obj)
end
exit_msg()
exit_msg: procedure expose units
do
parse arg message
if message ~= '' then call pdm_Inform(1,message,)
call pdm_SetUnits(units)
call pdm_AutoUpdate(0)
exit
end